package behavior.iterator;

import java.util.ArrayList;
import java.util.List;

public class InfoCollegeIterator implements Iterator {
    List<Department> departmentList = new ArrayList<Department>();
    int position = -1;

    public InfoCollegeIterator(List<Department> departmentList) {
        this.departmentList = departmentList;
    }

    @Override
    public boolean hasNext() {
        return position < departmentList.size() - 1;
    }

    @Override
    public Object next() {
        position += 1;
        return departmentList.get(position);
    }

}
